package top.ochiamalu.aioj.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.ochiamalu.aioj.enums.ThumbTypeEnum;
import top.ochiamalu.aioj.strategy.thumb.ThumbStrategy;
import top.ochiamalu.aioj.strategy.thumb.impl.CommentThumbStrategy;
import top.ochiamalu.aioj.strategy.thumb.impl.QuestionThumbStrategy;
import top.ochiamalu.aioj.strategy.thumb.impl.SetThumbStrategy;

import java.util.HashMap;
import java.util.Map;

/**
 * 点赞策略配置
 *
 * @author ochiamalu
 * @date 2025/03/07
 */
@Configuration
public class ThumbStrategyConfig {

    @Bean
    public Map<ThumbTypeEnum, ThumbStrategy> thumbStrategyMap(
            QuestionThumbStrategy questionThumbStrategy,
            SetThumbStrategy setThumbStrategy,
            CommentThumbStrategy commentThumbStrategy
    ) {
        Map<ThumbTypeEnum, ThumbStrategy> strategyMap = new HashMap<>();
        strategyMap.put(ThumbTypeEnum.QUESTION, questionThumbStrategy);
        strategyMap.put(ThumbTypeEnum.SET, setThumbStrategy);
        strategyMap.put(ThumbTypeEnum.COMMENT, commentThumbStrategy);
        return strategyMap;
    }
} 